class Stock:
    name = ''
    code = ''

    def __init__(self, name, code):
        self.name = name
        self.code = code


def convert_2_json(obj):
    return {
        "name": obj.name,
        "code": obj.code
    }
